<template>
	<view class="Myinfor">
		<u-skeleton
			:loading="loading"
			:animate="true"
			avatar
			rows="5"
		>
			<Header :userInfor="userInfor" />
			<Funpages :userId="userInfor.id" />
			<FunButtom />
		</u-skeleton>
	</view>
</template>

<script>
import header from './components/header.vue'
import funPages from './components/funPages.vue'
import FunButtom from './components/funButtom.vue'
import { userinfo } from '@/api/api_userInfo.js'
import { getToken, setUserInfo } from '@/store/user.js'
export default {
  components: {
    'Header': header,
    'Funpages': funPages,
    'FunButtom': FunButtom
  },
  data() {
    return {
      // 用户信息
      userInfor: {},
      loading: true
    }
  },
  async created() {
    const res = await userinfo(getToken())

    this.userInfor = { ...{
      credit: '良好', // 信用等级
      fans: 0, // 粉丝
      FocusOn: 0 // 关注
    }, ...res.data }
    setUserInfo(this.userInfor)
    this.loading = false
  },
  methods: {

  }
}
</script>

<style>
	.Myinfor{
		background: rgba(240, 242, 245, 1);
		min-height: 100vh;
	}
</style>
